/*
 * c9a.c
 * This program print a multi board of size defined by the user
 *
 * Binyamin 15 March 2018 
 */
#include<stdio.h>

int dcount(int num)
{
	int count=0;
	while(num>0)
	{
		count++;
		num/=10;
	}
	return count;
}
void print_mult_table(int max_mult)
{
	for(int i=1;i<=max_mult;i++)
	{
		for(int j=1;j<max_mult;j++)
			printf("%*d ",dcount(j*max_mult), i*j);
		printf("%*d\n",dcount(max_mult*max_mult), i*max_mult);
	}
}

int main()
{
	int max_mult;
	printf("Please enter number:\n");

	scanf("%d",&max_mult);

	print_mult_table(max_mult);

}

